#!/bin/bash

# Only run if this flag is set. The flag is created by the yum-cron init
# script when the service is started -- this allows one to use chkconfig and
# the standard "service stop|start" commands to enable or disable yum-cron.
if [[ ! -f /var/lock/subsys/yum-cron ]]; then
  exit 0
fi

# Action!
file="/var/log/yum-cron.log"
if [ ! -e $file ]
then
    touch /var/log/yum-cron.log
fi
    
date '+%Y%m%d%H%M' >>  /var/log/yum-cron.log
HName=`/bin/hostname -s`
echo $HName >> /var/log/yum-cron.log
exec /usr/sbin/yum-cron >> /var/log/yum-cron.log
#echo $? >> /var/log/yum-cron.log
